package cn.drenal.capcap.entity;

import cn.drenal.capcap.entity.base.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tangzc.autotable.annotation.ColumnComment;
import com.tangzc.autotable.annotation.ColumnDefault;
import com.tangzc.autotable.annotation.ColumnNotNull;
import com.tangzc.mpe.autotable.annotation.*;
import com.tangzc.mpe.processer.annotation.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 推荐作品表
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper
@Table(comment = "推荐作品表")
public class RecommendedArtwork extends BaseEntity {
    @ColumnComment("主键")
    @ColumnId(mode = IdType.AUTO)
    private Long id;

    @ColumnComment("作品ID")
    @ColumnNotNull
    private Long artworkId;

    @ColumnComment("推荐理由")
    @Column(length = 500)
    private String reason;

    @ColumnComment("排序")
    @ColumnNotNull
    @ColumnDefault("0")
    private Integer sort;

    @ColumnComment("状态：0-禁用，1-启用")
    @ColumnNotNull
    @ColumnDefault("1")
    private Integer status;

    @ColumnComment("推荐开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startTime;

    @ColumnComment("推荐结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endTime;
}